<template>
  <div class="app-container">
    <el-card class="box-card">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"  >

      <!-- 第一行-->

      <el-form-item label="证件编号" prop="certificateId">
        <el-input
          v-model="queryParams.certificateId"
          placeholder="请输入证件编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>


      <el-form-item label="身份证号" prop="idNumber" >
        <el-input
          v-model="queryParams.idNumber"
          placeholder="请输入身份证号"
          clearable
          maxlength="18"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="姓名" prop="username"  label-width="68px">
        <el-input
          v-model="queryParams.username"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"

        />
      </el-form-item>




      <el-form-item label="现任职务" prop="presentOccupation" v-show="showSearch">
        <el-select v-model="queryParams.presentOccupation"
                   placeholder="请选择现任职务"

                   clearable>
          <el-option
            v-for="dict in dict.type.yh_present_occupation"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"

          ></el-option>
        </el-select>

      </el-form-item>




      <!-- 第二行-->

      <el-form-item label="年龄" prop="age" label-width="68px" v-show="showSearch">
        <el-input
          v-model="queryParams.age"
          placeholder="请输入年龄"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>


<!--      <el-form-item label="部门" prop="deptid" v-show="showSearch">-->
<!--        <treeselect v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择部门" />-->
<!--        <el-select v-model="queryParams.deptid" placeholder="请选择部门">-->
<!--          <el-option-->
<!--            v-for="dict in dict.type.yh_deptid"-->
<!--            :key="dict.value"-->
<!--            :label="dict.label"-->
<!--            :value="dict.value"-->
<!--          ></el-option>-->
<!--        </el-select>-->
<!--      </el-form-item>-->





      <el-form-item label="手机号" prop="phoneOne" v-show="showSearch" label-width="68px">
        <el-input
          v-model="queryParams.phoneOne"
          placeholder="请输入手机号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <!-- 第三行-->

      <el-form-item label="籍贯" prop="nativePlace" v-show="showSearch" label-width="68px">
        <el-input
          v-model="queryParams.nativePlace"
          placeholder="请输入籍贯"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>


      <el-form-item label="最高学历" prop="highestEducation" v-show="showSearch">
        <el-select v-model="queryParams.highestEducation" placeholder="请输入最高学历" clearable>
          <el-option
            v-for="dict in dict.type.yh_highest_education"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          ></el-option>
        </el-select>
      </el-form-item>


      <!-- 第四行-->


      <el-form-item label="最高学位" prop="highestDegree" v-show="showSearch">
        <el-select v-model="queryParams.highestDegree" placeholder="请输入最高学位" clearable>
          <el-option
            v-for="dict in dict.type.yh_highest_degree"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          ></el-option>
        </el-select>

      </el-form-item>


      <el-form-item label="专业" prop="major" v-show="showSearch" label-width="68px">
        <el-input
          v-model="queryParams.major"
          placeholder="请输入专业"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>


      <el-form-item label="人员类别" prop="personnelCategory" v-show="showSearch">
        <el-input
          v-model="queryParams.personnelCategory"
          placeholder="请输入人员类别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="JX" prop="militaryRank"  label-width="68px">
        <el-select v-model="queryParams.militaryRank" placeholder="请输入现JX" clearable>
          <el-option
            v-for="dict in dict.type.yh_military_rank"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          ></el-option>
        </el-select>
      </el-form-item>


      <el-form-item label="政治面貌" prop="politics" v-show="showSearch">
<!--        <el-input-->
<!--          v-model="queryParams.politics"-->
<!--          placeholder="请输入政治面貌"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
        <el-select v-model="queryParams.politics" placeholder="请选择政治面貌" clearable>
          <el-option
            v-for="dict in dict.type.yh_politics"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          ></el-option>
        </el-select>
      </el-form-item>


      <div style="text-align: right;margin-right:-9px;">
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </div>

    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:baseinfo:add']"
        >新增
        </el-button>
      </el-col>


      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:baseinfo:remove']"
        >删除
        </el-button>
      </el-col>


      <el-col :span="1.5">
        <el-button
          type="info"
          plain
          icon="el-icon-upload2"
          size="mini"
          @click="handleImport"
          v-hasPermi="['system:baseinfo:import']"
        >导入
        </el-button>
      </el-col>


      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:baseinfo:export']"
        >导出
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="baseinfoList" border @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="序号" align="center" :index="indexMethod" type="index" width="50"/>
      <el-table-column label="姓名" align="center" prop="username" v-if="columns[0].visible"/>
      <el-table-column label="部职别" align="center" prop="departmentTitle" v-if="columns[1].visible"/>
      <el-table-column label="出生日期" align="center" prop="birth" v-if="columns[2].visible"/>
      <el-table-column label="性别" align="center" prop="gender" v-if="columns[3].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.gender"/>
        </template>
      </el-table-column>
      <el-table-column label="证件编号" align="center" prop="certificateId" v-if="columns[4].visible"/>
      <el-table-column label="年龄" align="center" prop="age" v-if="columns[5].visible"/>
<!--      <el-table-column label="部门" align="center" prop="dept.deptName" v-if="columns[6].visible"/>-->
      <el-table-column label="部门" align="center" prop="deptid" v-if="columns[6].visible">
      <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_deptid" :value="scope.row.deptid"/>
        </template>
      </el-table-column>
      <el-table-column label="身份证号" align="center" prop="idNumber" v-if="columns[7].visible"/>
      <el-table-column label="手机号" align="center" prop="phoneOne" v-if="columns[8].visible"/>
      <el-table-column label="籍贯" align="center" prop="nativePlace" v-if="columns[9].visible"/>
      <el-table-column label="出生地" align="center" prop="birthplace" v-if="columns[10].visible"/>
      <el-table-column label="民族" align="center" prop="nation" v-if="columns[11].visible"/>

      <el-table-column label="最高学历" align="center" prop="highestEducation" v-if="columns[12].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_highest_education" :value="scope.row.highestEducation"/>
        </template>
      </el-table-column>
      <el-table-column label="手机号2" align="center" prop="phoneSecond" v-if="columns[13].visible"/>
      <el-table-column label="最高学位" align="center" prop="highestDegree" v-if="columns[14].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_highest_degree" :value="scope.row.highestDegree"/>
        </template>
      </el-table-column>
      <el-table-column label="毕业学校" align="center" prop="graduationSchool" v-if="columns[15].visible"/>
      <el-table-column label="专业" align="center" prop="major" v-if="columns[16].visible"/>
      <el-table-column label="人员类别" align="center" prop="personnelCategory" v-if="columns[17].visible"/>
      <el-table-column label="政治面貌" align="center" prop="politics" v-if="columns[18].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_politics" :value="scope.row.politics"/>
        </template>
      </el-table-column>
      <el-table-column label="入党" align="center" prop="partyTime" width="180" v-if="columns[19].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.partyTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="参加工作时间" align="center" prop="workingTime" width="180" v-if="columns[20].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.workingTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="入伍时间" align="center" prop="militaryTime" width="180" v-if="columns[21].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.militaryTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="教育培训经历" align="center" prop="educationTraining" v-if="columns[22].visible"/>
      <el-table-column label="参加ZZ情况" align="center" prop="combatParticipation" v-if="columns[23].visible"/>
      <el-table-column label="参加重大JS行动情况" align="center" prop="majorOperations" v-if="columns[24].visible"/>
      <el-table-column label="奖惩情况" align="center" prop="reward" v-if="columns[25].visible"/>
      <el-table-column label="简历" align="center" prop="resume" v-if="columns[26].visible"/>
      <el-table-column label="首次招聘录用时间" align="center" prop="recruitmentTime" width="180" v-if="columns[27].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.recruitmentTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="岗位等级" align="center" prop="positionGrade" v-if="columns[28].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_position_grade" :value="scope.row.positionGrade"/>
        </template>
      </el-table-column>
      <el-table-column label="岗位等级时间" align="center" prop="positionGradeTime" width="180" v-if="columns[29].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.positionGradeTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="技术职务" align="center" prop="technicalPosition" v-if="columns[30].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_technical_position" :value="scope.row.technicalPosition"/>
        </template>
      </el-table-column>
      <el-table-column label="技术职务时间" align="center" prop="technicalPositionTime" width="180"
                       v-if="columns[31].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.technicalPositionTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="级别" align="center" prop="rank" v-if="columns[32].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_rank" :value="scope.row.rank"/>
        </template>
      </el-table-column>
      <el-table-column label="级别时间" align="center" prop="rankTime" width="180" v-if="columns[33].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.rankTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="现任职务" align="center" prop="presentOccupation" v-if="columns[34].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_present_occupation" :value="scope.row.presentOccupation"/>
        </template>
      </el-table-column>
      <el-table-column label="现职务层级" align="center" prop="currentJobLevel" v-if="columns[35].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_current_job_level" :value="scope.row.currentJobLevel"/>
        </template>
      </el-table-column>
      <el-table-column label="现职务层级时间" align="center" prop="currentPositionLevelTime" width="180"
                       v-if="columns[36].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.currentPositionLevelTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>

      <el-table-column label="职称" align="center" prop="positionalTitles" v-if="columns[45].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_work" :value="scope.row.positionalTitles"/>
        </template>
      </el-table-column>
      <el-table-column label="现JX" align="center" prop="militaryRank" v-if="columns[37].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_military_rank" :value="scope.row.militaryRank"/>
        </template>
      </el-table-column>
      <el-table-column label="现JX时间" align="center" prop="militaryRankTime" width="180" v-if="columns[38].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.militaryRankTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="待遇级别简历" align="center" prop="salaryLevelResume" v-if="columns[39].visible"/>
      <el-table-column label="创建者" align="center" prop="createBy" v-if="columns[40].visible"/>
      <el-table-column label="创建时间" align="center" prop="createTime" width="180" v-if="columns[41].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新者" align="center" prop="updateBy" v-if="columns[42].visible"/>
      <el-table-column label="更新时间" align="center" prop="updateTime" width="180" v-if="columns[43].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" v-if="columns[44].visible"/>


      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"

            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:baseinfo:edit']"
          >修改
          </el-button>
          <el-button
            size="mini"
            type="text"

            @click="handleDelete(scope.row)"
            v-hasPermi="['system:baseinfo:remove']"
          >删除
          </el-button>
          <el-button
            size="mini"
            type="text"

            @click="handleView(scope.row,scope.index)"
            v-hasPermi="['system:baseinfo:query']"
          >详细</el-button>
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            icon="el-icon-view"-->
<!--            @click="jumpFamily(scope.row,scope.index)"-->
<!--            v-hasPermi="['system:baseinfo:family']"-->
<!--          >亲属</el-button>-->
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    </el-card>

    <!--导入 -->
    <!-- 用户导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px">
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <div class="el-upload__tip" slot="tip">
            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的基本信息数据
          </div>
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link type="danger" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>


    <!-- v-model="form.name"自动将属性的值存入form对象中，即第842行-->
    <!-- 添加或修改基本信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" append-to-body width="1300px">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-container>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">个人基本信息</p>
            </el-divider>
          </el-header>

          <el-main>
            <!--第一行-->
            <el-row>
              <el-col :span="8">
                <el-form-item label="姓名" label-width="20%" prop="username">
                  <el-input v-model="form.username" placeholder="请输入姓名" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item label="性别" label-width="20%" prop="gender">
                  <el-select v-model="form.gender" placeholder="请选择性别" style="width:90%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.sys_user_sex"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item label="出生日期" label-width="20%" prop="birth">
                  <el-date-picker clearable
                                  v-model="form.birth"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择出生日期"
                                  style="width:90%;float:left">
                  </el-date-picker>
                  <!--          <el-input v-model="form.birth" placeholder="请输入出生日期"/>-->
                </el-form-item>
              </el-col>
            </el-row>

            <!--第2行-->
            <el-row>

              <el-col :span="8">
                <el-form-item label="年龄" label-width="20%" prop="age">
                  <el-input v-model="form.age" placeholder="请输入年龄" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>


              <el-col :span="8">
                <el-form-item label="证件编号" label-width="20%" prop="certificateId">
                  <el-input v-model="form.certificateId" placeholder="请输入证件编号" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item label="身份证号" label-width="20%" prop="idNumber">
                  <el-input v-model="form.idNumber" placeholder="请输入身份证号" maxlength="18" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>


            </el-row>


            <!--第4行-->
            <el-row>


              <el-col :span="8">

                <el-form-item label="部门" label-width="20%" prop="deptId" >
<!--                  <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择部门" style="width:90%;float:left"/>-->
                                  <el-select v-model="form.deptid" placeholder="请选择部门" style="width:90%;float:left">
                                    <el-option
                                      v-for="dict in dict.type.yh_deptid"
                                      :key="dict.value"
                                      :label="dict.label"
                                      :value="dict.value"
                                    ></el-option>
                                  </el-select>
                </el-form-item>
              </el-col>


              <el-col :span="8">
                <el-form-item label="籍贯" label-width="20%" prop="nativePlace">
                  <el-input v-model="form.nativePlace" placeholder="请输入籍贯" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item label="出生地" label-width="20%" prop="birthplace">
                  <el-input v-model="form.birthplace" placeholder="请输入出生地" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>


            </el-row>


            <!--第7行-->
            <el-row>
              <el-col :span="8">
                <el-form-item label="政治面貌" label-width="20%" prop="politics">
                  <el-select v-model="form.politics" placeholder="请选择政治面貌" style="width:90%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_politics"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item label="入党时间" label-width="20%" prop="partyTime">
                  <el-date-picker clearable
                                  v-model="form.partyTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择入党时间"
                                  style="width:90%;float:left">
                  </el-date-picker>
                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item label="人员类别" label-width="20%" prop="personnelCategory">
                  <el-input v-model="form.personnelCategory" placeholder="请输入人员类别" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>

            </el-row>


            <!--第7行-->
            <el-row>

              <el-col :span="8">
                <el-form-item label="民族" label-width="20%" prop="nation">
                  <!--                  <el-input v-model="form.nation" placeholder="请输入民族"/>-->
                  <el-select v-model="form.nation" filterable placeholder="请输入民族" style="width:90%;float:left" clearable>
                    <el-option
                      v-for="item in option_nation"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>




              <el-col :span="8">
                <el-form-item label="办公电话(内线)" label-width="20%" prop="phoneOne">
                  <el-input v-model="form.phoneOne" placeholder="请输入办公电话(内线)" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item label="办公电话(地方线)" label-width="20%" prop="phoneSecond">
                  <el-input v-model="form.phoneSecond" placeholder="请输入办公电话(地方线)" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>


            </el-row>


          </el-main>
        </el-container>

        <el-container>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">个人学历信息</p>
            </el-divider>
          </el-header>
          <el-main>


            <!--第5行-->
            <el-row>
              <el-col :span="8">
                <el-form-item label="最高学历" label-width="20%" prop="highestEducation" >
                  <el-select v-model="form.highestEducation" placeholder="请输入最高学历" style="width:90%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_highest_education"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>


              <el-col :span="8">
                <el-form-item label="最高学位" label-width="20%" prop="highestDegree">
                  <el-select v-model="form.highestDegree" placeholder="请输入最高学位" style="width:90%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_highest_degree"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item label="专业" label-width="20%" prop="major">
                  <el-input v-model="form.major" placeholder="请输入专业" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>
            </el-row>

            <!--第6行-->
            <el-row>
              <el-col :span="8">
                <el-form-item label="毕业学校" label-width="20%" prop="graduationSchool">
                  <el-input v-model="form.graduationSchool" placeholder="请输入毕业学校" style="width:90%;float:left"/>
                </el-form-item>
              </el-col>
            </el-row>

          </el-main>
        </el-container>
        <el-container>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">个人在职信息</p>
            </el-divider>
          </el-header>
          <el-main>


            <!--第1行-->
            <el-row>
              <el-col :span="12">
                <el-form-item label="参加工作时间" label-width="16%" prop="workingTime">
                  <el-date-picker clearable
                                  v-model="form.workingTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择参加工作时间"
                                  style="width:90%;float:left">
                  </el-date-picker>
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item label="部职别" label-width="17%" prop="departmentTitle">
                  <el-input v-model="form.departmentTitle" placeholder="请输入部职别" style="width:94%;float:left"/>
                </el-form-item>
              </el-col>
            </el-row>
            <!--第2行-->
            <el-row>
              <el-col :span="24">
                <el-form-item label="教育培训经历" label-width="8%" prop="educationTraining">
                  <el-input v-model="form.educationTraining" type="textarea" placeholder="请输入内容" style="width:97.3%;float:left"/>
                </el-form-item>
              </el-col>
            </el-row>
            <!--第3行-->
            <el-row>
              <el-col :span="12">
                <el-form-item label="首次录用时间" label-width="16%" prop="recruitmentTime">
                  <el-date-picker clearable
                                  v-model="form.recruitmentTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择首次录用时间"
                                  style="width:90%;float:left">
                  </el-date-picker>
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item label="现任职务" label-width="17%" prop="presentOccupation">

                  <el-select v-model="form.presentOccupation" placeholder="请输入现任职务"
                             style="width:94%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_present_occupation"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <!--第4行-->
            <el-row>
              <el-col :span="24">
                <el-form-item label="简历" label-width="8%" prop="resume">
                  <el-input v-model="form.resume" type="textarea" placeholder="请输入内容"
                            style="width:97.3%;float:left"/>
                </el-form-item>
              </el-col>
            </el-row>

            <!--第6行-->
            <el-row>


              <el-col :span="12">
                <el-form-item label="职务层级" label-width="16%" prop="currentJobLevel">
                  <el-select v-model="form.currentJobLevel" placeholder="请选择职务层级"
                             style="width:90%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_current_job_level"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item label="职务层级时间" label-width="17%" prop="currentPositionLevelTime">
                  <el-date-picker clearable
                                  v-model="form.currentPositionLevelTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择职务层级时间"
                                  style="width:94%;float:left">
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>
            <!--第7行-->
            <el-row>
              <el-col :span="12">
                <el-form-item label="技术职务" label-width="16%" prop="technicalPosition">
                  <el-select v-model="form.technicalPosition" placeholder="请选择技术职务" style="width:90%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_technical_position"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item label="技术职务时间" label-width="17%" prop="technicalPositionTime">
                  <el-date-picker clearable
                                  v-model="form.technicalPositionTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择技术职务时间"
                                  style="width:94%;float:left">
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>

            <!--第10行-->
            <el-row>
              <el-col :span="12">
                <el-form-item label="岗位等级" label-width="16%" prop="positionGrade">
                  <el-select v-model="form.positionGrade" placeholder="请选择岗位等级" style="width:90%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_position_grade"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item label="岗位等级时间" label-width="17%" prop="positionGradeTime">
                  <el-date-picker clearable
                                  v-model="form.positionGradeTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择岗位等级时间"
                                  style="width:94%;float:left">
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>

            <!--第11行-->
            <el-row>
              <el-col :span="12">
                <el-form-item label="级别" label-width="16%" prop="rank">
                  <el-select v-model="form.rank" placeholder="请选择级别" style="width:90%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_rank"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item label="级别时间" label-width="17%" prop="rankTime">
                  <el-date-picker clearable
                                  v-model="form.rankTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择级别时间"
                                  style="width:94%;float:left">
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>



          </el-main>
        </el-container>
        <el-container>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">其他履历信息</p>
            </el-divider>
          </el-header>
          <el-main>

            <!--第12行-->
            <el-row>
              <el-col :span="12">
                <el-form-item label="入伍时间" label-width="16%" prop="militaryTime">
                  <el-date-picker clearable
                                  v-model="form.militaryTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择入伍时间"
                                  style="width:90%;float:left">
                  </el-date-picker>
                </el-form-item>
              </el-col>


              <el-col :span="12">
                <el-form-item label="职称" label-width="17%" prop="positionalTitles">

<!--                  <el-input v-model="form.positionalTitles" placeholder="请输入职称" style="width:94%;float:left"/>-->
                  <el-select v-model="form.positionalTitles" placeholder="请选择职称" style="width:94%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.sys_work"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <!--第13行-->
            <el-row>

              <el-col :span="12">
                <el-form-item label="现JX" label-width="16%" prop="militaryRank">
                  <el-select v-model="form.militaryRank" placeholder="请选择现JX" style="width:90%;float:left" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_military_rank"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item label="现JX时间" label-width="17%" prop="militaryRankTime">
                  <el-date-picker clearable
                                  v-model="form.militaryRankTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择现JX时间"
                                  style="width:94%;float:left">
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="参加重大JS行动情况" label-width="8%" prop="majorOperations">
                  <el-input v-model="form.majorOperations" type="textarea" placeholder="请输入内容" style="width:97.3%;float:left"/>
                </el-form-item>
              </el-col>
            </el-row>
            <!--第12行-->
            <el-row>

              <el-col :span="24">
                <el-form-item label="参加ZZ情况" label-width="8%" prop="combatParticipation">
                  <el-input v-model="form.combatParticipation" type="textarea" placeholder="请输入内容" style="width:97.3%;float:left"/>
                </el-form-item>
              </el-col>
            </el-row>

            <!--第9行-->
            <el-row>
              <el-col :span="24">
                <el-form-item label="奖惩情况" label-width="8%" prop="reward">
                  <el-input v-model="form.reward" type="textarea" placeholder="请输入内容" style="width:97.3%;float:left"/>
                </el-form-item>
              </el-col>
            </el-row>


            <!--第14行-->
            <el-row>
              <el-col :span="24">
                <el-form-item label="待遇级别简历" label-width="8%" prop="salaryLevelResume">
                  <el-input v-model="form.salaryLevelResume" type="textarea" placeholder="请输入待遇级别简历" style="width:97.3%;float:left"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="备注" label-width="8%" prop="remark">
                  <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" style="width:97.3%;float:left"/>
                </el-form-item>
              </el-col>
            </el-row>


          </el-main>
        </el-container>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>



<!--=======================================================================================-->

    <!-- 查看详细信息对话框 -->
<!--    <el-dialog :title="view.title" :visible.sync="view.open"  append-to-body width="1300px">-->
<!--          <el-form ref="form" :model="famform" :rules="rules" label-width="80px">-->
<!--            <el-container>-->
<!--              <el-header>-->
<!--                <el-divider content-position="left">-->
<!--                  <p style="color: #00afff; font-size: 20px;">个人基本信息</p>-->
<!--                </el-divider>-->
<!--              </el-header>-->
<!--              <el-main>-->
<!--                &lt;!&ndash;第一行&ndash;&gt;-->
<!--                <el-row>-->
<!--                  <el-col :span="12">-->
<!--                    <el-form-item label="姓名" prop="username" label-width="24%">-->
<!--                      <el-input v-model="famform.username" placeholder="请输入姓名"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                  <el-col :span="12">-->
<!--                    <el-form-item label="证件编号" prop="certificateId" label-width="24%">-->
<!--                      <el-input v-model="famform.certificateId" placeholder="请输入证件编号"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                </el-row>-->

<!--                <el-row>-->
<!--                  <el-col :span="12">-->
<!--                    <el-form-item label="身份证号" prop="idNumber" label-width="24%">-->
<!--                      <el-input v-model="famform.idNumber" placeholder="请输入身份证号"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                  <el-col :span="12">-->
<!--                    <el-form-item label="部门" prop="deptId" label-width="24%">-->
<!--                      &lt;!&ndash;                  <el-input v-model="form.deptid" placeholder="请输入部门"/>&ndash;&gt;-->
<!--                      <treeselect v-model="famform.deptId" :options="deptOptions" :show-count="true" placeholder="请选择部门"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                </el-row>-->
<!--              </el-main>-->


<!--              <el-header>-->
<!--                <el-divider content-position="left" label-width="24%">-->
<!--                  <p style="color: #00afff; font-size: 20px;">家庭成员信息</p>-->
<!--                </el-divider>-->
<!--              </el-header>-->
<!--              <el-main>-->
<!--                <el-row>-->
<!--                  <el-col :span="12">-->
<!--                    <el-form-item label="称谓" prop="title" label-width="24%">-->
<!--                      <el-input v-model="famform.title" placeholder="请输入称谓"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                  <el-col :span="12">-->
<!--                    <el-form-item label="成员姓名" prop="familyName" label-width="24%">-->
<!--                      <el-input v-model="famform.familyName" placeholder="请输入成员姓名"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                </el-row>-->

<!--                <el-row>-->
<!--                  <el-col :span="12">-->
<!--                    <el-form-item label="成员身份证号" prop="familyIdNumber" label-width="24%">-->
<!--                      <el-input v-model="famform.familyIdNumber" placeholder="请输入成员身份证号"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                  <el-col :span="12">-->
<!--                    <el-form-item label="成员年龄" prop="familyAge" label-width="24%">-->
<!--                      <el-input v-model="famform.familyAge" placeholder="请输入成员年龄"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                </el-row>-->

<!--                <el-row>-->
<!--                  <el-col :span="12">-->
<!--                    <el-form-item label="成员政治面貌" prop="familyPolitics" label-width="24%">-->
<!--                      &lt;!&ndash;                  <el-input v-model="form.familyPolitics" placeholder="请输入成员政治面貌"/>&ndash;&gt;-->
<!--                      <el-select v-model="famform.familyPolitics" placeholder="请输入成员政治面貌" style="width:100%" >-->
<!--                        <el-option-->
<!--                          v-for="dict in dict.type.yh_politics"-->
<!--                          :key="dict.value"-->
<!--                          :label="dict.label"-->
<!--                          :value="dict.value"-->
<!--                        ></el-option>-->
<!--                      </el-select>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                  <el-col :span="12">-->
<!--                    <el-form-item label="成员电话" prop="familyPhone" label-width="24%">-->
<!--                      <el-input v-model="famform.familyPhone" placeholder="请输入成员电话"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->

<!--                </el-row>-->

<!--                <el-row>-->
<!--                  <el-col :span="24">-->
<!--                    <el-form-item label="成员工作单位及职务" prop="familyOccupation" label-width="12%">-->
<!--                      <el-input v-model="famform.familyOccupation" placeholder="请输入成员工作单位及职务"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                </el-row>-->
<!--                <el-row>-->
<!--                  <el-col :span="24">-->
<!--                    <el-form-item label="备注" prop="remark" label-width="12%">-->
<!--                      <el-input v-model="famform.remark" type="textarea" placeholder="请输入内容"/>-->
<!--                    </el-form-item>-->
<!--                  </el-col>-->
<!--                </el-row>-->
<!--              </el-main>-->
<!--            </el-container>-->

<!--          </el-form>-->
<!--          <div slot="footer" class="dialog-footer">-->

<!--            <el-button @click="viewCancel">取 消</el-button>-->
<!--          </div>-->
<!--    </el-dialog>-->


  </div>
</template>


<style>

  .el-header, .el-footer {
    background-color: #FFFFFF;
    color: #333;
    text-align: left;
    line-height: 60px;
    font-style: oblique;

  }

  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }

  .el-main {
    background-color: #FFFFFF;
    color: #333;
    text-align: center;
    line-height: 160px;
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }

  .el-dialog__title {
    /*color: #1ab394;*/
    font-weight: bold;
    font-size: 25px;
  }
  .input_text{
    background-color: #efefef;
    border-color: #efefef;
    border-style:solid;
    border-top-width:0px;
    border-right-width:0px;
    border-bottom-width:1px;
    border-left-width:0px;

    /*border-top-width: 0px;*/
    /*border-left-width: 0px;*/
    /*border-right-width: 0px;*/
    /*border-bottom-width: 1px;*/
  }

</style>


<script>
  /**
   *  {listBaseinfo, getBaseinfo,···}对应Baseinfo.js中的方法
   *  @/api/system/baseinfo也是对应的Baseinfo.js的路径
   */
  import {getToken} from "@/utils/auth";


  import {
    listBaseinfo,
    getBaseinfo,
    delBaseinfo,
    addBaseinfo,
    addFamily,
    updateBaseinfo,
    importTemplate
  } from "@/api/module/ls/baseinfo";
  // 导入模板接口importTemplate


  import {
    getFamily

  } from "@/api/module/ls/family";

  import {treeselect} from "@/api/system/dept";
  import Treeselect from "@riophae/vue-treeselect";
  import "@riophae/vue-treeselect/dist/vue-treeselect.css";

  export default {
    name: "Baseinfo",
    components: { Treeselect },
    dicts: ['sys_user_sex',
      'yh_deptid',
      'yh_highest_degree',
      'yh_highest_education',
      'yh_politics',
      'yh_position_grade',
    'yh_technical_position',
    'yh_rank',
    'yh_present_occupation',
    'yh_current_job_level',
    'yh_military_rank',
    'sys_work'],

    data() {
      return {
        option_nation: [
          {value: '汉族', label: '汉族'}, {value: '阿昌族', label: '阿昌族'},
          {value: '鄂温克族', label: '鄂温克族'}, {value: '傈僳族', label: '傈僳族'},
          {value: '水族', label: '水族'}, {value:'白族',label:'白族'},
          {value:'高山族',label:'高山族'}, {value:'珞巴族',label:'珞巴族'},
          {value:'塔吉克族',label:'塔吉克族'}, {value:'保安族',label:'保安族'},
          {value:'仡佬族',label:'仡佬族'}, {value:'满族',label:'满族'},
          {value:'塔塔尔族',label:'塔塔尔族'}, {value:'布朗族',label:'布朗族'},
          {value:'哈尼族',label:'哈尼族'}, {value:'毛南族',label:'毛南族'},
          {value:'土家族',label:'土家族'}, {value:'布依族',label:'布依族'},
          {value:'哈萨克族',label:'哈萨克族'}, {value:'门巴族',label:'门巴族'},
          {value:'土族',label:'土族'}, {value:'朝鲜族',label:'朝鲜族'},
          {value:'蒙古族',label:'蒙古族'}, {value:'佤族',label:'佤族'},
          {value:'达斡尔族',label:'达斡尔族'}, {value:'赫哲族',label:'赫哲族'},
          {value:'苗族',label:'苗族'}, {value:'维吾尔族',label:'维吾尔族'},
          {value:'傣族',label:'傣族'}, {value:'回族',label:'回族'},
          {value:'仫佬族',label:'仫佬族'}, {value:'乌孜别克族',label:'乌孜别克族'},
          {value:'德昂族',label:'德昂族'}, {value:'基诺族',label:'基诺族'},
          {value:'纳西族',label:'纳西族'}, {value:'锡伯族',label:'锡伯族'},
          {value:'东乡族',label:'东乡族'}, {value:'京族',label:'京族'},
          {value:'怒族',label:'怒族'}, {value:'瑶族',label:'瑶族'},
          {value:'侗族',label:'侗族'}, {value:'景颇族',label:'景颇族'},
          {value:'普米族',label:'普米族'}, {value:'彝族',label:'彝族'},
          {value:'独龙族',label:'独龙族'}, {value:'柯尔克孜族',label:'柯尔克孜族'},
          {value:'羌族',label:'羌族'}, {value:'裕固族',label:'裕固族'},
          {value:'俄罗斯族',label:'俄罗斯族'}, {value:'拉祜族',label:'拉祜族'},
          {value:'撒拉族',label:'撒拉族'}, {value:'藏族',label:'藏族'},
          {value:'鄂伦春族',label:'鄂伦春族'}, {value:'黎族',label:'黎族'},
          {value:'畲族',label:'畲族'}, {value:'壮族',label:'壮族'},
          {value:'穿青族',label:'穿青族'}, {value:'达曼族',label:'达曼族'},
        ],
        labelStyle: { 'width': '140px','color': '#000000', },
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        //部门树选择
        deptOptions: undefined,
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: false,
        // 总条数
        total: 0,
        // 基本信息表格数据
        baseinfoList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          username: null,
          departmentTitle: null,
          birth: null,
          gender: null,
          certificateId: null,
          age: null,
          deptid: null,
          idNumber: null,
          phoneOne: null,
          nativePlace: null,
          birthplace: null,
          nation: null,
          highestEducation: null,
          phoneSecond: null,
          highestDegree: null,
          graduationSchool: null,
          major: null,
          personnelCategory: null,
          politics: null,
          partyTime: null,
          workingTime: null,
          militaryTime: null,
          educationTraining: null,
          combatParticipation: null,
          majorOperations: null,
          reward: null,
          resume: null,
          recruitmentTime: null,
          positionGrade: null,
          positionGradeTime: null,
          technicalPosition: null,
          technicalPositionTime: null,
          rank: null,
          rankTime: null,
          presentOccupation: null,
          currentJobLevel: null,
          currentPositionLevelTime: null,
          militaryRank: null,
          militaryRankTime: null,
          salaryLevelResume: null,
          createBy: null,
          createTime: null,
          updateBy: null,
          updateTime: null,
          remark: null,
          positionalTitles:null,
          note1: null,
          note2: null,
          note3: null,
          note4: null,
          note5: null,
          note6: null,
          note7: null,
          note8: null,
          note9: null,
          note10: null
        },
        // 用户查询参数
        view:{
          // 是否显示弹出层（用户查询）
          open: false,
          // 弹出层标题（用户查询）
          title: "",
        },
        // 列信息
        columns: [
          {key: 0, label: `姓名`, visible: true},
          {key: 1, label: `部职别`, visible: false},
          {key: 2, label: `出生日期`, visible: false},
          {key: 3, label: `性别`, visible: false},
          {key: 4, label: `证件编号`, visible: true},
          {key: 5, label: `年龄`, visible: false},
          {key: 6, label: `部门`, visible: true},
          {key: 7, label: `身份证号`, visible: true},
          {key: 8, label: `手机号1`, visible: true},
          {key: 9, label: `籍贯`, visible: false},
          {key: 10, label: `出生地`, visible: false},
          {key: 11, label: `民族`, visible: false},
          {key: 12, label: `最高学历`, visible: false},
          {key: 13, label: `手机号2`, visible: false},
          {key: 14, label: `最高学位`, visible: false},
          {key: 15, label: `毕业学校`, visible: false},
          {key: 16, label: `专业`, visible: false},
          {key: 17, label: `人员类别`, visible: false},
          {key: 18, label: `政治面貌`, visible: false},
          {key: 19, label: `入党`, visible: false},
          {key: 20, label: `参加工作时间`, visible: false},
          {key: 21, label: `入伍时间`, visible: false},
          {key: 22, label: `教育培训经理`, visible: false},
          {key: 23, label: `参加zz情况`, visible: false},
          {key: 24, label: `参加重大js行动情况`, visible: false},
          {key: 25, label: `奖惩情况`, visible: false},
          {key: 26, label: `简历`, visible: false},
          {key: 27, label: `首次招聘录用时间`, visible: false},
          {key: 28, label: `岗位等级`, visible: false},
          {key: 29, label: `岗位等级时间`, visible: false},
          {key: 30, label: `技术职务`, visible: false},
          {key: 31, label: `技术职务时间`, visible: false},
          {key: 32, label: `级别`, visible: false},
          {key: 33, label: `级别时间`, visible: false},
          {key: 34, label: `现任职务`, visible: true},
          {key: 35, label: `现职务层级`, visible: false},
          {key: 36, label: `现职务层级时间`, visible: false},
          {key: 37, label: `现jx`, visible: false},
          {key: 38, label: `现jx时间`, visible: false},
          {key: 39, label: `待遇级别简历`, visible: false},
          {key: 40, label: `创建者`, visible: false},
          {key: 41, label: `创建时间`, visible: false},
          {key: 42, label: `更新者`, visible: false},
          {key: 43, label: `更新时间`, visible: false},
          {key: 44, label: `备注`, visible: false},
          {key: 45, label: `职称`, visible: false}
        ],
        // 表单参数
        form: {},
        familyform:{},
        // 表单校验
        rules: {
          certificateId: [
            { required: true, message: "证件编号不能为空", trigger: "blur" },
          ],
          idNumber: [
            { required: true, message: "身份证号不能为空", trigger: "blur" },
          ],
          deptid: [
            { required: true, message: "部门不能为空", trigger: "blur" },
          ],
          username: [
            { required: true, message: "姓名不能为空", trigger: "blur" },
          ],
        },
        // 用户导入参数
        upload: {
          // 是否显示弹出层（用户导入）
          open: false,
          // 弹出层标题（用户导入）
          title: "",
          // 是否禁用上传
          isUploading: false,
          // 是否更新已经存在的用户数据
          updateSupport: 0,
          // 设置上传的请求头部
          headers: {Authorization: "Bearer " + getToken()},
          // 上传的地址
          url: process.env.VUE_APP_BASE_API + "/ls/baseinfo/importData"
        }
      };
    },

    created() {
      this.getList();
      this.getTreeselect();
    },
    methods: {
      getTreeselect(){
        treeselect().then(response => {
          this.deptOptions = response.data;
        });
      },
      /** 查询基本信息列表 */
      getList() {
        this.loading = true;
        listBaseinfo(this.queryParams).then(response => {
          this.baseinfoList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 取消按钮
      viewCancel() {
        this.view.open = false;
      },

      // 表单重置
      reset() {
        this.form = {
          id: null,
          username: null,
          departmentTitle: null,
          birth: null,
          gender: null,
          certificateId: null,
          age: null,
          deptid: null,
          idNumber: null,
          phoneOne: null,
          nativePlace: null,
          birthplace: null,
          nation: null,
          highestEducation: null,
          phoneSecond: null,
          highestDegree: null,
          graduationSchool: null,
          major: null,
          personnelCategory: null,
          politics: null,
          partyTime: null,
          workingTime: null,
          militaryTime: null,
          educationTraining: null,
          combatParticipation: null,
          majorOperations: null,
          reward: null,
          resume: null,
          recruitmentTime: null,
          positionGrade: null,
          positionGradeTime: null,
          technicalPosition: null,
          technicalPositionTime: null,
          rank: null,
          rankTime: null,
          presentOccupation: null,
          currentJobLevel: null,
          currentPositionLevelTime: null,
          militaryRank: null,
          militaryRankTime: null,
          salaryLevelResume: null,
          createBy: null,
          createTime: null,
          updateBy: null,
          updateTime: null,
          remark: null,
          note1: null,
          note2: null,
          note3: null,
          note4: null,
          note5: null,
          note6: null,
          note7: null,
          note8: null,
          note9: null,
          note10: null
        };
        this.resetForm("form");
      },

      /** 下载模板操作 */
      importTemplate() {
        this.download('/ls/baseinfo/importTemplate', {}, `user_template_${new Date().getTime()}.xlsx`)
      },
      // 亲属新增按钮
      jumpFamily(row){
        //this.reset();
        const id = row.id || this.ids
        getBaseinfo(id).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "新增亲属信息";
        });

      },
      /** 导入按钮操作 */
      handleImport() {
        this.upload.title = "用户导入";
        this.upload.open = true;
      },
      // 文件上传中处理
      handleFileUploadProgress(event, file, fileList) {
        this.upload.isUploading = true;
      },
      // 文件上传成功处理
      handleFileSuccess(response, file, fileList) {
        this.upload.open = false;
        this.upload.isUploading = false;
        this.$refs.upload.clearFiles();
        this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
        this.getList();
      },
      // 提交上传文件
      submitFileForm() {
        this.$refs.upload.submit();
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      /** 详细按钮操作 */
      handleView(row) {
        // const id = row.id || this.ids
        // getBaseinfo(id).then(response => {
        //   this.form = response.data;
        //   this.view.open = true;
        //   this.view.title = "基本信息查看";
        //
        // });
        const id = row.id;
        this.$router.push({ path:"/jiben/baseinfo_detail", query: {id}});
        console.log(id);
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加基本信息";
      },
      /** 修改按钮操作，response为后台返给前台的结果 */
      handleUpdate(row) {
        this.reset();
        //const tableName = row.tableName || this.tableNames[0];
        //const id = row.id || this.ids[0];
        //const params = { pageNum: this.queryParams.pageNum };
        const id = row.id || this.ids
        getBaseinfo(id).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "基本信息修改";
        });
        //this.$router.push({ path: '/module/ls/baseinfo_modify'})
        //this.$tab.openPage("修改基本信息", '/module/ls/baseinfo-edit/'+id, params);
      },
      indexMethod(index) {
        index = (index + 1) + (this.queryParams.pageNum - 1) * this.queryParams.pageSize
        return index
      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.form.id != null) {
              updateBaseinfo(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              });
            } else {
              addBaseinfo(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              });
              // addFamily(this.form).then(response => {
              //   this.$modal.msgSuccess("新增成功");
              //   this.open = false;
              //   this.getList();
              // });
            }
          }
        });
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const ids = row.id || this.ids;
        const i=row.username || this.is;
        this.$modal.confirm('是否确认删除"' + i + '"的数据项？').then(function () {
          return delBaseinfo(ids);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {
        });
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('system/baseinfo/export', {
          ...this.queryParams
        }, `baseinfo_${new Date().getTime()}.xlsx`)
      }

    }
  };
</script>
